remotemanager.decorators.sanzufunction module

class remotemanager.decorators.sanzufunction.SanzuWrapper(function, *args, **kwargs)[source]

Decorator class to allow you to

Wrap a function with @SanzuFunction to store:

>>> from remotemanager import URL
>>> url = URL(...)
>>> @SanzuFunction(url=url)
>>> def func(val):
>>>     return val
>>> func(val=3)  # creates a Dataset and runs this function on `url`

Call this function will transparently create a Dataset, execute the function remotely (synchronously), and return the result.

The function should be called with explicitly named keyword arguments, but logic exists to attempt to match args to kwargs

property dataset: Dataset

Return the current Dataset used for this function

Returns:

associated Dataset

Return type:

(Dataset)

remotemanager.decorators.sanzufunction.SanzuFunction(*args, **kwargs)[source]

Actual decorator wrapper for SanzuFunction

In order to make a decorator callable, Python seems to require an actual function call that returns the class.

Parameters:
  • *args – args to pass through to the Dataset

  • **kwargs – kwargs to pass through to the Dataset

Returns:

decorator